
import request from '../../utils/request';
//data：post请求中携带的数据（obj格式），params：get请求中携带的数据（就是在浏览器地址xx/xx/xx后面?XX=oo&XX=oo这部分数据，obj格式）
//管理员登陆
export default{
/*-------------------------------------------------------------角色相关-------------*/ 
    //角色列表
    roleList: query => {
        return request({
            url: '/pet-admin/system/role/listPage',
            method: 'post',
            data: query
        });
    },
    //角色编辑
    roleUpdate: query => {
        return request({
            url: '/pet-admin/system/role/edit',
            method: 'post',
            data: query
        });
    },
    //角色新增
    roleAdd: query => {
        return request({
            url: '/pet-admin/system/role/add',
            method: 'post',
            data: query
        });
    },
    //角色状态切换
    roleEditStatus: query => {
        return request({
            url: '/pet-admin/system/role/edit/status',
            method: 'post',
            data: query
        });
    },
    //角色详细
    roleInfo: query => {
        return request({
            url: '/pet-admin/system/role/detail',
            method: 'post',
            data: query
        });
    },
    //角色数据范围
    rolwDataScope: query => {
        return request({
            url: '/pet-admin/system/role/edit/dataScope',
            method: 'post',
            data: query
        });
    },
    
    //角色删除
    deleteRole: query => {
        return request({
            url: '/pet-admin/system/role/delete',
            method: 'post',
            data: query
        });
    },
// 获取已分配角色的用户列表
    allocatedUserList: query => {
        return request({
            url: '/pet-admin/system/role/user/allocatedListPage',
            method: 'post',
            data: query
        });
    },
// 取消分配用户系统角色
    authUserCancel: query => {
        return request({
            url: '/pet-admin/system/role/user/unAuth',
            method: 'post',
            data: query
        });
    },
// 获取未分配角色的用户列表
    unallocatedUserList: query => {
        return request({
            url: '/pet-admin/system/role/user/unAllocatedListPage',
            method: 'post',
            data: query
        });
    },
// 分配用户系统角色
    authUserSelectAll: query => {
        return request({
            url: '/pet-admin/system/role/user/authUser',
            method: 'post',
            data: query
        });
    },
  
    /*-------------菜单相关-------------*/ 
    // 菜单树
    menuTreeselect: query => {
        return request({
            url: '/pet-admin/system/menu/treeList',
            method: 'post',
            data: query
        });
    },

    // 部门树
    deptTreeselect: query => {
        return request({
            url: '/pet-admin/system/dept/treeList',
            method: 'post',
            data: query
        });
    },
    
}
